import React from 'react';

import {ToastComponent, AlertComponent} from 'amis';
import useAmis from '@/uses/useAmis';

const APP = () => {
  const TestComponent = useAmis({
    type: 'page',
    body: 'test',
  });

  const AMISComponent = useAmis({
    type: 'page',
    body: {
      type: 'form',
      api: '/api/form?amis=1',
      label: '测试表单',
      body: [
        {
          type: 'input-text',
          name: 'name',
          label: '姓名'
        },
        {
          name: 'email',
          type: 'input-email',
          label: '邮箱'
        },
        {
          name: 'color',
          type: 'input-color',
          label: 'color'
        }
      ]
    }
  })

  return (
    <>
      <ToastComponent key="toast" position={'top-right'} />
      <AlertComponent key="alert" />
      <TestComponent />
      <AMISComponent />
    </>
  );
}

export default APP;
